//
//  UIImage+image.swift
//  开心微博
//
//  Created by 郑开心 on 15/12/5.
//  Copyright © 2015年 郑开心. All rights reserved.
//

import UIKit

extension UIImage{
    class func imageWithOriginalName(name: String) -> UIImage?{
        let image = UIImage(named: name)
        
        return image?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
    }
    
    class func imageWithStretchableName(imageName: String) -> UIImage{
        let image = UIImage(named: imageName)
        
        return (image?.stretchableImageWithLeftCapWidth(Int(image!.size.width * CGFloat(0.5)) , topCapHeight: Int(image!.size.height * CGFloat(0.5))))!
    }
}
